package com.xc.stock.dto;

import java.math.BigDecimal;
import java.util.Date;

import com.ag.utils.DateUtils;
import com.ag.utils.StringConvertJSONObjectSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xc.stock.infrastructure.db.po.AccountPO;
import com.xc.stock.utils.fastjson.DateJsonSerializer;
import com.xc.stock.utils.jackjson.String2JsonObjSerializer;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * AccountDTO
 *
 * @author xlfd
 * @email xlfd@gmail.com
 * @created 2022/03/25
 */
@Data
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
public class AccountDTO extends AccountPO {
	String accountTypeText;

	@Override
	public BigDecimal getBalance() {
		return super.getBalance();
	}

	@JsonSerialize(using = DateJsonSerializer.class)
	@JSONField(format = DateUtils.YYYY_MM_DD_HH_MM_SS)
	@Override
	public Date getUpdateAt() {
		return super.getUpdateAt();
	}

	@JsonSerialize(using = DateJsonSerializer.class)
	@JSONField(format = DateUtils.YYYY_MM_DD_HH_MM_SS)
	@Override
	public Date getCreateAt() {
		return super.getCreateAt();
	}

	@JsonSerialize(using = String2JsonObjSerializer.class)
	@JSONField(serializeUsing = StringConvertJSONObjectSerializer.class)
	@Override
	public String getExt() {
		return super.getExt();
	}
}
